//
//  LHQDestinationphotoCollectionViewCell.m
//  God_is_a_Girl
//
//  Created by dllo on 15/9/24.
//  Copyright (c) 2015年 呸. All rights reserved.
//

#import "LHQDestinationphotoCollectionViewCell.h"
#import <UIImageView+WebCache.h>
@implementation LHQDestinationphotoCollectionViewCell
-(instancetype)initWithFrame:(CGRect)frame
{
    
    self = [super  initWithFrame:frame];
    if (self) {
        
        self.cover = [[UIImageView  alloc] init];
        [self.contentView  addSubview:self.cover];
        
        self.name = [[UILabel  alloc] init];
        [self.contentView  addSubview:self.name];
        
        
    }
    
    return self;
    
}

-(void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    
    [super  applyLayoutAttributes:layoutAttributes];
    
    self.cover.frame =CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
    
    self.cover.layer.cornerRadius = 8;
    self.cover.layer.masksToBounds = YES;
    
    self.name.frame = CGRectMake(10, self.frame.size.width-90, self.frame.size.width, 50);
    
    self.name.font = [UIFont  systemFontOfSize:15];
    [self.name  setTextColor:[UIColor whiteColor]];

}
-(void)setModel:(LHQDestinationPhotoModel *)model
{
    
    [self.cover  sd_setImageWithURL:[NSURL  URLWithString:model.cover] placeholderImage:[UIImage  imageNamed:@"1436964361872.jpg"]];
    
    
    self.name.text = model.name;
   
    
}





@end
